package com.cskaoyan.mapper.impl;

import com.cskaoyan.bean.City;
import com.cskaoyan.mapper.CityMapper;
import com.cskaoyan.utils.MybatisUtils;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class CityMapperImpl implements CityMapper {

    @Override
    public City selectCityById(Integer id) {

        SqlSession sqlSession = MybatisUtils.getSqlSession();
        City city = sqlSession.selectOne("cskaoyan.selectCityById", id);

        return city;
    }

    @Override
    public List<City> selectAllCity() {

        SqlSession sqlSession = MybatisUtils.getSqlSession();

        List<City> list = sqlSession.selectList("cskaoyan.selectAllCity");

        return list;
    }


}
